import axios from './axios'

// 查询货号数据/导出
export function getArtNo(params = {}) {
  return axios({
    url: '/kinds-number/kindsNumber',
    params
  })
}

// 获取导出报表链接
export function getExportLink(params) {
  return axios({
    url: '/kinds-number/getExportLink',
    params
  })
}

// 根据货号获取所有货号数组
export function getArtNoList(params) {
  return axios({
    url: '/kinds-number/kindsNumberList',
    params
  })
}

//添加按钮
// export function postNumber(params){
//     return axios({
//         method:'post',
//         url:'/kinds-number/kindsNumberWashPrint',
//         params
//     })
// }

// 改正部类
export function correctCommodityType() {
  return axios({
    url: '/kinds-number/correctCommodityType'
  })
}

// 新增/修改货号对象
export function postKindsNumber(data) {
  return axios({
    method: 'post',
    url: '/kinds-number/kindsNumber',
    data
  })
}

//下拉查询部类
export function getCategory() {
  return axios({
    url: '/commodity-type/commodityType'
  })
}
//改订/ 修改货号里的款号/色号
export function putkindsNumber(params) {
  return axios({
    method: 'put',
    url: '/kinds-number/kindsNumber',
    params
  })
}
//删除货号对象
export function deleteArtNo(params) {
  return axios({
    method: 'delete',
    url: '/kinds-number/kindsNumber',
    params
  })
}

//获取下拉框集合
export function getAggregate() {
  return axios({
    url: '/kinds-number/kindsNumberOptions'
  })
}

// 获取货号成分对象集
export function getKindsNumberIngredient(params = {}) {
  return axios({
    url: '/kinds-number-ingredient/kindsNumberIngredient',
    params
  })
}
// 新增货号成分对象
export function postKindsNumberIngredient(params) {
  return axios({
    method: 'post',
    url: '/kinds-number-ingredient/kindsNumberIngredient',
    params
  })
}

// 更新货号成分对象
export function putKindsNumberIngredient(params) {
  return axios({
    method: 'put',
    url: '/kinds-number-ingredient/kindsNumberIngredient',
    params
  })
}

// 根据货号获取所有货号数组  // 没有传参数的话，params默认就是一个空对象，给了默认值 为 {}
export function getKindsNumberList(params = {}) {
  return axios({
    url: '/kinds-number/kindsNumberList',
    params
  })
}

export function searchQuery(data) {
  return axios({
    method: 'post',
    url: '/kinds-number/searchQuery',
    data
  })
}

// /获取已有的执行标准数组
export function standardList() {
  return axios({
    url: '/kinds-number-ingredient/standardList'
  })
}

export function modifyKindsNumbers(data) {
  return axios({
    method: 'post',
    url: '/kinds-number/modifyKindsNumbers',
    data
  })
}

// 删除货号成分对象
export function delateIngredient(params) {
  return axios({
    method: 'delete',
    url: '/kinds-number-ingredient/kindsNumberIngredient',
    params
  })
}

// 导入
export function importKindsNumber(data) {
  return axios({
    method: 'post',
    url: '/kinds-number/importKindsNumber2',
    data
  })
}

// 批量导入修改
export function importKindsNumberByUpdate(data) {
  return axios({
    method: 'post',
    url: '/kinds-number/importKindsNumberByUpdate',
    data
  })
}
